<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    body{
        font-family: cursive;
    }
</style>
<body>
<script>
    var num=5;
    for(var i=0; i<num; i++){
        var as=num-i-1;
        for(var j=0; j<as; j++){
            document.write("&nbsp")
        }
        var nbsp = (i+1)*2-1;
        for(var k=0; k<nbsp; k++){
            document.write("*")
        }
        document.write("<br>")
    }
</script>
</body>
</html>